package com.book.helper;

import com.book.dto.ShopDetailDto;
import com.book.pojo.ShopDetail;
import org.springframework.beans.BeanUtils;

/**
 * @Author 李锦程
 * @Date 2021/4/24 9:24 下午
 * @Package com.book.helper
 * @Version 1.0
 */
public class ShopCarDetailHelper {

    public static ShopDetail covertDtoPo(ShopDetailDto shopDetailDto) {
        if (shopDetailDto == null){
            return null;
        }
        ShopDetail sd = new ShopDetail();
        BeanUtils.copyProperties(shopDetailDto,sd);
        return sd;
    }

    public static ShopDetailDto covertPoDto(ShopDetail shopDetail) {
        if (shopDetail == null){
            return null;
        }
        ShopDetailDto shopDetailDto = new ShopDetailDto();
        BeanUtils.copyProperties(shopDetail,shopDetailDto);
        return shopDetailDto;
    }
}
